/**
 * 绘制圆形座椅策略
 */
import namespace from "../../namespace";

class RectanglePolicy extends namespace.policy.canvas.BasisShapePolicy {
  constructor() {
    super();
  }

  createFeakeShape(x, y) {
    if (this.shape) {
      return this.shape;
    }

    // 绘制图形
    this.shape = new namespace.shape.Rectangle();

    this.shape.show = () => {
      this.shape.setCanvas(this.canvas);
    };

    this.shape.hide = () => {
      this.shape.setCanvas(null);
    };

    this.shape.show();

    this.shape.setPosition(x, y);
  }
}

namespace.policy.canvas.RectanglePolicy = RectanglePolicy;
